package lee.vioson.ebook.utils

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.navigation.NavHostController
import lee.vioson.ebook.ui.AppDestinations
import lee.vioson.remotedata.bean.BookData
import lee.vioson.remotedata.bean.Chapter

/**
 *Author:viosonlee
 *Date:2023/6/15
 *DESCRIPTION:
 */
enum class BookJumper {
    INSTANCE;

    var book: BookData? by mutableStateOf(null)
    var chapter: Chapter? by mutableStateOf(null)
    fun jumpToChapterDetail(chapter: Chapter, book: BookData, navHostController: NavHostController) {
        this.book = book
        this.chapter = chapter
        navHostController.navigate(AppDestinations.READ_ROUTE)
    }
}